package com.supreme.aspectserver.controller;

import com.supreme.aspectserver.component.BaseCache;
import com.supreme.aspectserver.service.simple.BaseService;
import com.supreme.aspectserver.utils.StringCacheUtils;
import com.supreme.commonboot.utils.AjaxResp;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "base")
public class BaseController {

    @Resource
    private BaseService baseService;

    @Resource
    private BaseCache baseCache;

    @GetMapping(value = "index")
    public AjaxResp index() {
        baseService.showMessage();
        final String stringCache = baseCache.newStringCache();
        final BaseCache baseCache = StringCacheUtils.getBaseCacheBean();
        final String stringCache1 = baseCache.newStringCache();
        return AjaxResp.instance(stringCache1);
    }
}
